﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using WXY.Course.Common.MVCExtension;

namespace WXY.Course.Model
{
    /// <summary>
    /// 分页展示视图模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PageViewModel<T>
    {
        public PageInfo PageInfo { get; set; }

        public IList<T> Value { get; set; }

        public int Count
        {
            get { return HasValue ? Value.Count : 0; }
        }

        /// <summary>
        /// 模型中是否有数据
        /// </summary>
        public bool HasValue
        {
            get
            {
                return Value != null && Value.Count > 0;
            }
        }

        public string Message { get; set; }
    }
}